home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Developer Utilities / Installer 4.0.3 SDK / Script Examples / Install PowerMac [ compressed ] / InstallFatApp.r < prev    next >
Encoding:
Text File  |  1994-11-15  |  43.7 KB  |  1,406 lines  |  [TEXT/MPS ]

  1. //
  2. //    Install Fat App.r
  3. //
  4. //    This install script demonstrates the installation of an application that    
  5. //    can run on a Power Macintosh in Native Mode, a 68000 Macintosh, or both.
  6. //
  7. //    The ability for an application to run under either a PowerMac or 68K machine
  8. //    is referred to as a Fat Application. This decidely untechnical term refers
  9. //    simply to the fact that the application contains more resources than are
  10. //    needed to run on one platform or the other, and is larger than a version
  11. //    of the same application that runs on only a single platform. 
  12. //
  13. //    The main purpose of this installer script is to allow for installation
  14. //    of a Fat Application, or alternatively either the 68K only version, or
  15. //    the PowerMac only version.
  16. //
  17. //    This is easy to accomplish through Easy Install, as the scriptwriter
  18. //    has complete control over what is going to be installed.
  19. //
  20. //    What is not easy to accomplish is the creation of one package in Custom
  21. //    Install, that will install the Fat Application, but has two sub-packages
  22. //    that will install either the 68K only version or the PowerMac only version
  23. //    if selected individually, but install the Fat Application if they are
  24. //    both selected.
  25. //
  26. //    The above described Custom Install scenario has been requested by
  27. //    scriptwriters within Apple and by 3rd party developers as something
  28. //    they would like to be able to do. The specific needs of your project
  29. //    may differ. If the demands of the Custom Install scenario described do
  30. //    not apply to your situation, then your install script may end up being
  31. //    a lot simpler than this example.
  32. //
  33. //    NOTE: Since the original creation of this script three changes have been
  34. //    made. Installation of the PowerMac data fork is now accomplished via
  35. //    InstaCompOne file compression, and the installation of 68K CODE resource 
  36. //    items is now accomplished via InstaCompOne resource compression. A 'vers'
  37. //    resource item has been added to the resource fork of the archive containing
  38. //    the data fork for the PowerMac.
  39. //
  40. //    For simplicity of scripting, all files and resource items that can be
  41. //    installed have been grouped into four categories:
  42. //        1) PowerMac specific stuff
  43. //        2) 68K specific stuff
  44. //        3) Common stuff ( used by either 68K or PowerMac )
  45. //        4) PowerMac Warning on 68K ( used by the PowerMac only version )
  46. //
  47. //    From the applications 'ModApp.Fat' ( which can be found inside the folder
  48. //    'Sources:ModApp.FAT app:' ) and 'NotPPC' ( which can be found 
  49. //    inside the folder 'NotPPC:' ) four files have been created, each file
  50. //     containing the items for one of the above described categories. These
  51. //    four files will be used as the sources for installation.
  52. //
  53. //    To create the four files described above:
  54. //        1) Start with a complete Fat Application
  55. //        2) Remove all CODE resources from the Fat Application
  56. //                and put them in a new ResEdit file
  57. //        3) Save this ResEdit file as "68K Macintosh Part"
  58. //        4) Continue using the modified Fat Application
  59. //        5) Remove all remaining resources, except for the 'cfrg' item
  60. //                and put them in a new ResEdit file
  61. //        6) Save this ResEdit file as "Common Part"
  62. //        7) Rename the modified Fat Application as "Power Macintosh Part" and
  63. //                change it's type and creator to 'rsrc' and 'RSED'.
  64. //                WARNING: The "Power Macintosh Part" must contain the data fork
  65. //                of the original Fat Application, so don't just copy the
  66. //                'cfrg' resource item to a new ResEdit file and save it.
  67. //        8) Copy all the resources from "NotPPC" application
  68. //                into a new ResEdit file.
  69. //        9) Save this ResEdit file  as "PowerMacWarnOn68K Part"
  70. //    
  71. //    NOTE: All the above desribed steps can be accomplished in ResEdit
  72. //    except for the renaming of a file. To rename a file, or create a copy
  73. //    with another name, rename the file or copy from within the Finder. To
  74. //    change the file type and creator, open the file within ResEdit and select
  75. //    "Get Info for <filename>" from the File menu.
  76. //    
  77. //
  78. //    When installing one of the three basic scenarios ( PowerMac, 68K, Fat App ) 
  79. //    install the following groups for each:
  80. //        1) 68K         <= 68K specific stuff,         Common stuff
  81. //        2) PowerMac <= PowerMac specific stuff, Common stuff, PowMac Warn on 68K
  82. //        3) Fat App     <= PowerMac specific stuff, 68K specific stuff, Common stuff
  83. //
  84. //    NOTE: Because of Custom Install design specs ( described earlier ), we have
  85. //    to be a little tricky when designing the PowerMac package to be added to
  86. //    Custom Install. It is necessary to include the "PowerMac Warn on 68K" module 
  87. //     in the PowerMac portion. But we don't know when the PowerMac portion is 
  88. //    selected from Custom Install whether it is part of a complete Fat App 
  89. //    installation or part of a PowerMac only installation.
  90. //
  91. //
  92. //    Contents of each installation source file :
  93. //
  94. //        68K Macintosh Part         
  95. //                -    'CODE' (0) resource item         // CODE for 68K app
  96. //                -    'CODE' (1) resource item         // CODE for 68K app
  97. //                -    'CODE' (2) resource item         // CODE for 68K app
  98. //
  99. //        Power Macintosh Part
  100. //                -     data fork                        // CODE for PowerMac app
  101. //                -    'cfrg' (0) resource item        // describes data fork contents
  102. //
  103. //        Common Part                
  104. //                - This file contains all the resources in the Fat App
  105. //                except for the actual CODE to run the program on either
  106. //                platform ( 68K or PowerMac ), and except for the 'cfrg'
  107. //                resource item from the PowerMac portion.
  108. //                                
  109. //        PowerMac Warning On 68K    
  110. //                -    'CODE' (0) resource item        // 68K CODE for NotPPC alert
  111. //                -    'CODE' (1) resource item        // 68K CODE for NotPPC alert
  112. //                -    'ALRT' (27309) resource item    // rsrc's for NotPPC alert
  113. //                -    'DITL' (27309) resource item    // rsrc's for NotPPC alert
  114. //                -    'STR ' (27309) resource item    // rsrc's for NotPPC alert
  115. //
  116. //    NOTE: In the PowerMac application, the CODE for the program is stored
  117. //        in the DATA fork of the application. In the 68K application, the 
  118. //        CODE for the program is stored in resource items of type 'CODE'.
  119. //        Because the PowerMac CODE is stored in the data fork, we must use 
  120. //        a file atom ( 'infa' ) to handle installation of the CODE to run 
  121. //        the program. Because the 68K CODE is stored in resources, 
  122. //        we can use resource atoms ( 'inra' ) to handle installation.
  123. //
  124. //
  125. //    IMPORTANT: The 68K specific portion of the installation consists entirely
  126. //    of five 'CODE' type resource items, numbered 0 to 4. The "PowerMac Warning
  127. //    on 68K" portion of the installation contains among other things two 'CODE' 
  128. //    type resource items, numbered 0 to 1 ( the same CODE resources that
  129. //    were created as the "NotPPC" code resource ). The sole purpose of the two 
  130. //    'CODE' resource items within "PowerMac Warning on 68K" portion is to provide 
  131. //    an alert when the PowerMac only version of the application is launched on 
  132. //    a 68K system. This alert explains to the user that there's not much of a 
  133. //    chance that the application can run successfully on a 68K system. Special 
  134. //    care needs to be exercized so that the 68K specific 'CODE' resource items 
  135. //    are NEVER replaced by any of the PowerMac specific 'CODE' resource items. 
  136. //
  137. //    Now for the really interesting part. Because of the design spec for Custom
  138. //    Install ( described earlier ), we must take different approaches to the
  139. //    Custom Installation packages depending on whether or not the target 
  140. //    application already exists. Remember that we need to be careful when
  141. //    installing "PowerMac Warning on 68K" CODE resource items, that these
  142. //    resource items never overwrite the 68K CODE resource items.
  143. //
  144. //    If the target application already exists we must use resource atoms 
  145. //    ( 'inra' ) to install the "PowerMac Warning on 68K" CODE resources. 
  146. //    The "keepExisting" flag provided with the resource atom ( 'inra' ) 
  147. //    allows us to prevent resource items from replacing any existing resource 
  148. //    items of the same resource type and resource ID. This will prevent the 
  149. //    "PowerMac Warning on 68K" resource items from replacing 68K code resources.
  150. //
  151. //    If the target application does not already exist we must use 
  152. //    ResMerge ( 'inrm' ) atoms to install the "PowerMac Warning on 68K" 
  153. //    CODE resources. The installer checks before installation to see whether 
  154. //    or not resource items being installed will be replacing existing resources. 
  155. //    If resource items are installed after installation begins, even though we 
  156. //    have told the installer to "keepExisting" resource items, it will overwrite  
  157. //    them if the resource items did not exist before installation began. Using a 
  158. //    ResMerge ( 'inrm' ) atom to handle installation of "PowerMac Warning on 68K"
  159. //    CODE resources will force the "PowerMac Warning on 68K" resource items
  160. //    to be installed before the 68K CODE resources. This is because the
  161. //    68K CODE resource items are installed via resource atoms ( 'inra' ) , 
  162. //    and in this case the "PowerMac Warning on 68K" CODE resource items are 
  163. //    being installed using ResMerge ( 'inrm' ) atoms. ResMerge atoms are always 
  164. //    processed before resource atoms. 
  165. //
  166. //
  167. //    IMPORTANT: It is necessary to place the "PowerMac Warn on 68K"
  168. //    portion file on the first installation disk so that it is assured that
  169. //    the "PowerMac Warn on 68K" portion is processed before the "68K" portion.
  170. //    This is only necessary for the case where the target application does not
  171. //    already exist, but we have no way of knowing whether this condition will
  172. //    exist or not at the time that the installation script is written.
  173. //
  174. //    Because we must take different approaches ( depending on whether or not
  175. //    the target application already exists ) to installing the PowerMac
  176. //    portion of the application under Custom Install, we must load different
  177. //    packages into the list that the user can select from in Custom Install.
  178. //    Each package provides installation of the Fat Application, with subpackages
  179. //    allowing the user to select either the 68K only version, the PowerMac only
  180. //    version, or both. The difference between the Custom Install packages is
  181. //    whether ResMerge ( 'inrm' ) or resource atoms ( 'inra' ) were used to install 
  182. //    the "PowerMac Warning on 68K" CODE resources.
  183. //
  184. //
  185. //    When installing the PowerMac CODE that is stored in the data fork, it is
  186. //    necessary to use a file atom ( 'infa' ) to copy over the data fork into
  187. //    the target application. Note that the file atom we use specifies that
  188. //    the resource fork will not be replaced in the existing target application,
  189. //     if any, through the setting of the flag 'noRsrcFork'.
  190. //
  191. //
  192. //    When installing the "Common Part", it's okay to always overwrite the existing
  193. //    resource items. This allows us to use the resource merge atom ( 'inrm' ). 
  194. //    Resource merge atoms take all the resource items from the resource fork of
  195. //    the source file and "merge" those resources into the resource fork of a 
  196. //    new or existing target file. Resource merge atoms do not, however, allow
  197. //    specification of flags to control installation. Resource merge atoms 
  198. //    always overwrite resource items that have the same resource type and ID.
  199. //
  200. //
  201. //
  202. //     Layout and description of files contained within this example folder :
  203. //
  204. //    Main folder :
  205. //
  206. //        Install Fat App.r            - source script ( .r ) for installation
  207. //
  208. //        Makefile                    - MPW script that creates finished install 
  209. //                                        script from the source script ( .r )
  210. //
  211. //        Install Fat App                - finished installation script
  212. //
  213. //        Install Fat App w/ Debugger    - finished installation script containing 
  214. //                                      debugger information
  215. //
  216. //        Wasabi Debugger Log File    - text file containing results from last
  217. //                                      installation run with debugger
  218. //
  219. //        CheckIfInternalRuleFunc        - code resource that is called within
  220. //                                      install script during installation
  221. //                                      to check if selected target volume
  222. //                                      is internal hard disk ( building of
  223. //                                      this code resource is automated
  224. //                                      within the Makefile )
  225. //
  226. //        CheckIfInternalRuleFunc.SYM - symbols file used for running
  227. //                                      code resource in SADE debugger
  228. //
  229. //        CheckIfInternalRuleFunc.c.o - object file created by compiling
  230. //                                      CheckIfInternalRuleFunc.c
  231. //                                      
  232. //        CheckIfInternalRuleFunc.c     - source file used to create 
  233. //                                      compiled code resource
  234. //
  235. //
  236. //    ModApp Parts :
  237. //
  238. //        68K Macintosh Part            - 68K specific portion of application
  239. //
  240. //        Power Macintosh Part        - PowerMac specific portion of application
  241. //
  242. //        Common Part                    - portion necessary for either machine type
  243. //
  244. //    NOTE on ModApp Parts - these files are not automatically created by the
  245. //    makefile for 'Install Fat App'. The scriptwriter should prepare similiar
  246. //    modules for their project by taking a finished copy of a Fat Application
  247. //    and copying and pasting the correct resource items into the three files.
  248. //
  249. //
  250. //        ModApp.Fat                - application that supports either 68K or
  251. //                                PowerMac Native Mode. This file is not
  252. //                                included in the installation, but is used
  253. //                                as the source for the three files listed
  254. //                                in 'Source Files'. The various 68K
  255. //                                specific parts are cut and copied into 
  256. //                                '68K Macintosh Part', the PowerMac specific
  257. //                                stuff is cut and copied into 'Power Mac part', 
  258. //                                and everything remaining is copied into 
  259. //                                'Common Part'. In addition the two resource 
  260. //                                items 'CODE' (0) and (1)  from 'NotPPC' are 
  261. //                                copied into 'Power Mac Part'.
  262. //
  263. //
  264. //    NotPPC :
  265. //
  266. //        NotPPC                    - module containing the two 'CODE' resource
  267. //                                items that will provide an alert when the
  268. //                                PowerMac only version is launched on 68K.
  269. //
  270. //        NotPPC ReadMe            - explains the NotPPC files and functionality
  271. //
  272. //        NotPPC.c                - source for NotPPC module
  273. //
  274. //        NotPPC.h                - defines for NotPPC.c
  275. //    
  276. //        NotPPC.make                - makefile for NotPPC module
  277. //
  278. //        NotPPC.o                - object file for NotPPC module
  279. //
  280. //        NotPPC.r                - resource definitions for NotPPC module
  281. //
  282. //
  283. //    NOTE on NotPPC    - this module is not automatically created by the makefile
  284. //    that generates the finished installer script. The main reason for this is
  285. //    that the NotPPC module is a standardized method for dealing with the situation
  286. //    where the user attempts to launch a PowerMac application on the 68K platform.
  287. //    Scriptwriters should not need to make any changes to this module. If you wish
  288. //    to make any changes, simply set the current directory for MPW to ':NotPPC:'
  289. //    and run the makefile to build a new version of 'NotPPC' code resource. 
  290. //    Be sure to copy the two 'CODE' resources (0) and (1) into the file
  291. //    'PowerMacWarnOn68K Part' in the 'Source Files' folder.
  292. //    
  293. //
  294. //    Other Considerations:
  295. //
  296. //    - it is simpler to split the 68K and PowerMac CODE resources into two
  297. //    different source files, because these CODE resources occupy the same
  298. //    resource type and ID in the installed application.
  299. //
  300. //    - often times a Fat Application cannot fit onto a single installation
  301. //    disk, and splitting the Fat Application into it's "logical" pieces
  302. //    is a convenient way to split the file
  303. //
  304. //    - splitting the Fat Application allows us to create a simpler method
  305. //    for creating a variety of target applications, such as 68K only,
  306. //    PowerMac only, and a full Fat Application version.
  307. //
  308. //    - splitting the Fat Application also allows us to use less space on the
  309. //    installation disks, then would be taken if we included three full and distinct
  310. //    versions on the installation disks.
  311. //
  312. //
  313. //
  314. //        mark young • 08/20/94
  315. //
  316. //        Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
  317. //
  318.  
  319. /************************** 
  320.  
  321.  
  322. // Easy Install Package List:
  323.  
  324.     • pick the first applicable case
  325.     
  326.     Target already exists as Fat Application:
  327.         - install Full Fat Application ( update )
  328.     
  329.     Target already exists as 68K version on PowerMac:
  330.         - install Full Fat Application ( update )
  331.     
  332.     Target already exists as PowerMac version on 68K:
  333.         - install Full Fat Application ( update )
  334.     
  335.     Target already exists, and target volume is an external drive:
  336.         - install Full Fat Application ( update )
  337.     
  338.     Target volume is an external drive:
  339.         - install Full Fat Application ( install )
  340.     
  341.     Target machine is a 68K:
  342.         - install 68K Application
  343.     
  344.     Target machine is a PowerMac:
  345.         - install PowerMac Application ( update )
  346.     
  347.     Otherwise:
  348.         - display error that "machine must be 68K or PowerMac"
  349.     
  350.     NOTE: This last case ( Otherwise ) is actually not needed since
  351.     the only time it would be evoked is when the machine being installed
  352.     to is not a 68K or PowerMac. But if the user managed to get the installer
  353.     application to launch on a TRS-80, the user would get a cool error message.
  354.     
  355.  
  356. // Custom Install Package List:
  357.  
  358.     • pick the first applicable case
  359.  
  360.     Target already exists:
  361.  
  362.         - add update full fat app package
  363.  
  364.         // includes the following two subpackages as selectable options
  365.         
  366.         "Demo Application for 68K Macintosh"
  367.         "Demo Application for Power Macintosh" ( update )
  368.  
  369.     Otherwise:
  370.  
  371.         - add install full fat app package
  372.  
  373.         // includes the following two subpackages as selectable options
  374.         
  375.         "Demo Application for 68K Macintosh"
  376.         "Demo Application for Power Macintosh" ( install )
  377.  
  378.  
  379. **********************************/
  380.  
  381.  
  382. include "CheckIfInternalRuleFunc";
  383.  
  384. #include "InstallerTypes.r"
  385.  
  386. // include the InstaCompOne atom extender stuff
  387. // making sure not to add their version resource
  388. // to our installer script
  389. include ":::InstaCompOne 1.0:InstaCompOneAtomExt.rsrc" NOT 'vers';
  390.  
  391. #define currentReleaseDate        -1470076096        
  392. #define currentVersion            0x01008000
  393.  
  394.  
  395. /********************* Easy Install Rule resources *****************************/
  396.  
  397.  
  398. // • Rule function code resource ( 'inrf' )
  399.  
  400. // This code resource, which must be referenced from within a call by
  401. // checkRuleFunction{} within a rule clause, returns true if the 
  402. // selected target volume for the installation has a SCSI ID# of 0,
  403. // otherwise it returns false. This, in effect, is a check to see
  404. // if the selected target volume is the internal drive of the machine
  405. // being installed onto.
  406. #define kCheckIfInternalDriveUFID    9000
  407.  
  408.  
  409. // • Values for checkGestalt rule clause
  410.  
  411. #define gestaltSystemType            'sysa'             // processor type
  412. #define gestalt68Ksysa                1                // 68000 designator
  413. #define gestaltPPCsysa                2                // PowerMac designator
  414.  
  415. // • assertions
  416.  
  417. // NOTE: Assertions are simply a technique for eliminating repetitive 
  418. // condition checks, as well as clarifying rule frameworks. Checks
  419. // are made once and assertions are set. Those assertions are checked
  420. // later within rule clauses, which then take action based on the 
  421. // conditions found earlier.
  422.  
  423. // NOTE: Just defining an assertion does not set that assertion. To set an
  424. // assertion you must call AddAssertion{} from within a rule clause.
  425.  
  426. #define kUpdatingTargetFile            701
  427. #define kUpdating68Kpart            702
  428. #define kUpdatingPowerMacPart        703
  429. #define kTgtVolIsInternalDrive        704
  430. #define kTgtVolIsExternalDrive        705
  431. #define kMachineIsPowerPC            706
  432.  
  433. // • constants for packages and atoms
  434.  
  435. #define    kInstallFullFatApp            30000    // used for package
  436. #define    kUpdateFullFatApp            30001    // used for package
  437. #define    kOverWrite68KApp            30002    // used for package
  438. #define    kUpdatePowerMacApp            30003    // used for package
  439. #define    kInstallPowerMacApp            30004    // used for package
  440. #define    kDeleteFullApp                30005    // used for package
  441.  
  442. #define    kCommonStuff                30006    // used for package and atoms
  443. #define    k68KStuff                    30007    // used for package and atoms
  444. #define    kPowerMacStuff                30008    // used for package
  445.  
  446. #define    kInstallPowMacWarnOn68K        30009    // used for package
  447. #define    kUpdatePowMacWarnOn68K        30010    // used for package
  448. #define    kAddPowerMacTo68KApp        30011    // used for package
  449.  
  450. #define    kPowerMacFileAtom            30012    // used for file atom
  451. #define    kPowerMacRsrcAtom            30013    // used for rsrc atom    
  452.  
  453. // • Rule frameworks
  454.  
  455. // • Global framework
  456.  
  457. resource 'infr' (kGlobalFrameworkRsrcID) {
  458.     format0  {{
  459.         // run through all these rule clauses
  460.         pickAll,    { 701, 702, 703, 704, 705, 706 },
  461.     }};
  462. };
  463.  
  464. // if target file exists, set assertion kUpdatingTargetFile
  465. resource 'inrl' (701, "Check if target file already exists") {
  466.     format0 {{
  467.         CheckFileRsrcForkExists { 10000 },
  468.         AddAssertion {{ kUpdatingTargetFile }}
  469.     }};
  470. };
  471.  
  472. // if 68K version exists, set assertion kUpdating68Kpart
  473. resource 'inrl' (702, "Check if 68K version already exists") {
  474.     format0 {{
  475.         CheckAllAssertions {{ kUpdatingTargetFile }},
  476.         CheckFileContainsRsrcByID { 10000, 'CODE', 2 },
  477.         AddAssertion {{ kUpdating68Kpart }}
  478.     }};
  479. };
  480.  
  481. // if PowerMac version exists, set assertion kUpdatingPowerMacPart
  482. resource 'inrl' (703, "Check if PowerMac version already exists") {
  483.     format0 {{
  484.         CheckAllAssertions {{ kUpdatingTargetFile }},
  485.         CheckFileContainsRsrcByID { 10000, 'cfrg', 0 },
  486.         AddAssertion {{ kUpdatingPowerMacPart }}
  487.     }};
  488. };
  489.  
  490. // if target volume is external drive, set assertion kTgtVolIsInternalDrive
  491. resource 'inrl' (704, "Check if installing to internal volume") {
  492.     format0 {{
  493.         checkRuleFunction { kCheckIfInternalDriveUFID },
  494.         AddAssertion {{ kTgtVolIsInternalDrive }}
  495.     }};
  496. };
  497.  
  498. // if target volume is external drive, set assertion kTgtVolIsExternalDrive
  499. resource 'inrl' (705, "Check if installing to external volume") {
  500.     format0 {{
  501.         CheckAnyNonAssertion {{ kTgtVolIsInternalDrive }},
  502.         AddAssertion {{ kTgtVolIsExternalDrive }}
  503.     }};
  504. };
  505.  
  506.  
  507. // if machine is a PowerPC, set assertion kMachineIsPowerPC
  508. resource 'inrl' (706, "Check if machine is PowerPC") {
  509.     format0 {{
  510.         checkGestalt {gestaltSystemType, { gestaltPPCsysa } },
  511.         AddAssertion {{ kMachineIsPowerPC }}
  512.     }};
  513. };
  514.  
  515.  
  516. // • Easy Install framework
  517.  
  518. resource 'infr' (kEasyInstallFrameworkRsrcID) {
  519.     format0  {{
  520.         // pick the first true rule clause and
  521.         // add the appropriate package to Easy Install
  522.         pickFirst,    { 800, 801, 802, 803, 804, 805, 806, 807 },
  523.         }};
  524.     };
  525.  
  526. // if target file exists already, and
  527. // target file supports 68K and PowerMac,
  528. // add 68K and PowerMac packages and description to Easy Install
  529. // • this option is for updating an existing target application
  530. resource 'inrl' (800, "Check if updating FAT") {
  531.     format0 {{
  532.         CheckAllAssertions {{ kUpdating68Kpart, kUpdatingPowerMacPart }},
  533.         addUserDescription {"Click Install button to install\n" },
  534.         addUserDescription {"  • Demo Application for Any Macintosh\n"},
  535.         addPackages {{ kUpdateFullFatApp }}
  536.         }};
  537.     };
  538.  
  539. // if target file exists already, and
  540. // target file supports 68K but NOT Native Mode, and
  541. // target system is a PowerMac,
  542. // add 68K and PowerMac packages and description to Easy Install
  543. // • this option is for updating an existing target application
  544. resource 'inrl' (801, "Check if updating 68K version to a PowerMac") {
  545.     format0 {{
  546.         CheckAllAssertions {{ kUpdating68Kpart, kMachineIsPowerPC }},
  547.         addUserDescription {"Click Install button to install\n" },
  548.         addUserDescription {"  • Demo Application for Any Macintosh\n"},
  549.         addPackages {{ kUpdateFullFatApp }}
  550.         }};
  551.     };
  552.  
  553. // if target file exists already, and
  554. // target file supports Native Mode but NOT 68K, and
  555. // target system is a 68K,
  556. // add 68K and PowerMac packages and description to Easy Install
  557. // • this option is for updating an existing target application
  558. resource 'inrl' (802, "Check if updating PowerMac version to a 68K") {
  559.     format0 {{
  560.         CheckAllAssertions {{ kUpdatingPowerMacPart }},
  561.         CheckAllNonAssertions {{ kMachineIsPowerPC }},
  562.         addUserDescription {"Click Install button to install\n" },
  563.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  564.         addPackages {{ kUpdateFullFatApp }}
  565.         }};
  566.     };
  567.  
  568. // if target file exists already, and
  569. // installation is being performed to an external drive,
  570. // add 68K and PowerMac packages and description to Easy Install
  571. // • this option is for updating an existing target application
  572. resource 'inrl' (803, "Check if installing to an external drive") {
  573.     format0 {{
  574.         CheckAllAssertions {{ kUpdatingTargetFile }},
  575.         CheckAllAssertions {{ kTgtVolIsExternalDrive }},
  576.         addUserDescription {"Click Install button to install\n" },
  577.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  578.         addPackages {{ kUpdateFullFatApp }}
  579.         }};
  580.     };
  581.  
  582. // if target file does not exist already, and
  583. // installation is being performed to an external drive,
  584. // add 68K and PowerMac packages and description to Easy Install
  585. resource 'inrl' (804, "Check if installing to an external drive") {
  586.     format0 {{
  587.         CheckAllAssertions {{ kTgtVolIsExternalDrive }},
  588.         addUserDescription {"Click Install button to install\n" },
  589.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  590.         addPackages {{ kInstallFullFatApp }}
  591.         }};
  592.     };
  593.  
  594. // if target machine is a 68K,
  595. // add full 68K application package and description to Easy Install
  596. resource 'inrl' (805, "Check if installing to a 68K machine") {
  597.     format0 {{
  598.         CheckAllNonAssertions {{ kMachineIsPowerPC }},
  599.         addUserDescription {"Click Install button to install\n" },
  600.         addUserDescription {"  • Demo Application for your 68K Macintosh\n" },
  601.         addPackages {{ kOverWrite68KApp }}
  602.         }};
  603.     };
  604.  
  605. // if target machine is a PowerMac,
  606. // add full PowerMac application package and description to Easy Install
  607. resource 'inrl' (806, "Check if PowerMac machine") {
  608.     format0 {{
  609.         CheckAllAssertions {{ kMachineIsPowerPC }},
  610.         addUserDescription {"Click Install button to install\n" },
  611.         addUserDescription {"  • Demo Application for your Power Macintosh\n" },
  612.         addPackages {{ kUpdatePowerMacApp }}
  613.         }};
  614.     };
  615.  
  616. // if none of the other rule clauses in this set were satisfied
  617. // • this rule should never fire, but it's there just in case !!
  618. resource 'inrl' (807, "Otherwise handle as Fat App") {
  619.     format0 {{
  620.         ReportSysError {"Target System must be a 68K or PowerMac "
  621.                         "for installation."},
  622.         }};
  623.     };
  624.  
  625.  
  626. /******************* Custom Install Rule resources ***************************/
  627.  
  628. // • Custom Install framework
  629.  
  630. resource 'infr' (kCustomInstallFrameworkRsrcID) {
  631.     format0  {{
  632.         // pick the first true rule clause and
  633.         // add the appropriate package to Custom Install
  634.         pickFirst,    { 901, 902 },
  635.     }};
  636. };
  637.  
  638. // add package with all items to Custom Install for existing target app
  639. resource 'inrl' (901, "Add Custom Selection for Existing Target Application") {
  640.     format0 {{
  641.  
  642.         // only do this rule if target app already exists
  643.         CheckAllAssertions {{ kUpdatingTargetFile }},
  644.         
  645.         // contains all three choices for installing app from Custom Install
  646.         // but uses resource atoms ( 'inra' ) to handle installation of the
  647.         // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
  648.         addCustomItems {{ kUpdateFullFatApp }}    
  649.         
  650.         }};
  651.     };
  652.  
  653. // add package with all items to Custom Install for new target app
  654. resource 'inrl' (902, "Add Custom Selection for New Target Application") {
  655.     format0 {{
  656.  
  657.         // contains all three choices for installing app from Custom Install
  658.         // but uses ResMerge atoms ( 'inrm' ) to handle installation of the
  659.         // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
  660.         addCustomItems {{ kInstallFullFatApp }}    
  661.         
  662.         }};
  663.     };
  664.  
  665. /********************* Packages resources *****************************/
  666.  
  667. // Package for Demo App as fat app
  668. // this option is to be used when the target application is already present
  669. // • this package is one of the two main Custom Install packages
  670. resource 'inpk' ( kUpdateFullFatApp ) {
  671.     format0 {
  672.         showsOnCustom, removable, dontForceRestart,
  673.         kUpdateFullFatApp, 0, "Demo Application for Any Macintosh ( update )",
  674.             {
  675.             //  Delete entire file ( Custom Removal only )
  676.             'inpk', kDeleteFullApp,            
  677.  
  678.             //  68K part ( always overwrite )
  679.             'inpk', kOverWrite68KApp,        
  680.             
  681.             //  PowerMac part ( always overwrite )
  682.             'inpk', kUpdatePowerMacApp,    
  683.             
  684.             // NOTE: although the packages for 68K and PowerMac
  685.             // both include the common resources package, the
  686.             // common resources package will only be added once
  687.             // to the list of packages to be installed.
  688.             }
  689.         }
  690.     };
  691.  
  692. // Package for Demo App as fat app
  693. // this option is to be used when the target application is not already present
  694. // • this package is one of the two main Custom Install packages
  695. resource 'inpk' ( kInstallFullFatApp ) {
  696.     format0 {
  697.         showsOnCustom, removable, dontForceRestart,
  698.         kInstallFullFatApp, 0, "Demo Application for Any Macintosh ( install )",
  699.             {
  700.             //  Delete entire file ( Custom Removal only )
  701.             'inpk', kDeleteFullApp,            
  702.  
  703.             //  68K part ( always overwrite )
  704.             'inpk', kOverWrite68KApp,        
  705.             
  706.             //  PowerMac part ( always overwrite )
  707.             'inpk', kInstallPowerMacApp,    
  708.             
  709.             // NOTE: although the packages for 68K and PowerMac
  710.             // both include the common resources package, the
  711.             // common resources package will only be added once
  712.             // to the list of packages to be installed.
  713.             }
  714.         }
  715.     };
  716.  
  717. // Package for Demo App for 68K only via resource atoms
  718. resource 'inpk' ( kOverWrite68KApp ) {
  719.     format0 {
  720.         showsOnCustom, notRemovable, dontForceRestart,
  721.         kOverWrite68KApp, 0, "Demo Application for 68K Macintosh",
  722.             {    
  723.             // Common Resource fork ( always overwrite )
  724.             'inpk', kCommonStuff,    
  725.             
  726.             // 68K Macintosh CODE Resources
  727.             // this option utilizes 'inra' atoms that will always
  728.             // overwrite the target resource items 
  729.             'inpk', k68KStuff,    
  730.             }
  731.         }
  732.     };
  733.  
  734. // Package to Update Demo App for PowerMac
  735. // this option is to be used when the target application is already present
  736. resource 'inpk' ( kUpdatePowerMacApp ) {
  737.     format0 {
  738.         showsOnCustom, notRemovable, dontForceRestart,
  739.         kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
  740.             {    
  741.             // Common resources    ( always overwrite )
  742.             'inpk', kCommonStuff,    
  743.  
  744.             // PowerMac Data Fork and resources ( always overwrite )
  745.             'inpk', kPowerMacStuff,    
  746.             
  747.             // PowerMac warning when launched on 68K ( never overwrite )
  748.             'inpk', kUpdatePowMacWarnOn68K,    
  749.             // has to be inra so it doesn't overwrite existing stuff
  750.                             
  751.             }
  752.         }
  753.     };
  754.  
  755. // Package to Install Demo App for PowerMac
  756. // this option is to be used when the target application is not already present
  757. resource 'inpk' ( kInstallPowerMacApp ) {
  758.     format0 {
  759.         showsOnCustom, notRemovable, dontForceRestart,
  760.         kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
  761.             {    
  762.             // Common resources    ( always overwrite )
  763.             'inpk', kCommonStuff,    
  764.  
  765.             // PowerMac Data Fork and resources ( always overwrite )
  766.             'inpk', kPowerMacStuff,    
  767.             
  768.             // PowerMac warning when launched on 68K ( never overwrite )
  769.             // has to be inrm so it goes first, at this point we don't know
  770.             // whether both the PowerMac and 68K versions will be installed
  771.             // or if only the PowerMac version is going to be installed. This
  772.             // comes from the design specification that both the 68K and PowerMac
  773.             // only versions will be presented as subpackages of the Fat App
  774.             // under Custom Install. 
  775.             'inpk', kInstallPowMacWarnOn68K,    
  776.             }
  777.         }
  778.     };
  779.  
  780. // Package to add PowerMac version to 68K version
  781. resource 'inpk' ( kAddPowerMacTo68KApp ) {
  782.     format0 {
  783.         doesntShowOnCustom, removable, dontForceRestart,
  784.         0, 0, "Package to add PowerMac support to 68K application",
  785.             {    
  786.             // Common resources    ( always overwrite )
  787.             'inpk', kCommonStuff,    
  788.  
  789.             // PowerMac Data Fork and resources ( always overwrite )
  790.             'inpk', kPowerMacStuff,
  791.             }
  792.         }
  793.     };
  794.  
  795. // Sub-Package to DELETE entire app, whether 68K or PowerMac
  796. resource 'inpk' ( kDeleteFullApp ) {
  797.     format0 {
  798.         doesntShowOnCustom, removable, dontForceRestart,
  799.         0, 0, "Package to delete the demo app",
  800.             {    
  801.             // Delete entire file on Custom Removal
  802.             'infa', kDeleteFullApp,        
  803.             }
  804.         }
  805.     };
  806.  
  807. // Sub-Package of Common Resources
  808. resource 'inpk' ( kCommonStuff ) {
  809.     format0 {
  810.         doesntShowOnCustom, notRemovable, dontForceRestart,
  811.         0, 0, "Sub-Package of Common Resources",
  812.             {    
  813.             //  Common Resources ( always overwrite )
  814.             'inrm', kCommonStuff,    
  815.             }
  816.         }
  817.     };
  818.  
  819. // Sub-Package of 68K specific resources
  820. resource 'inpk' ( k68KStuff ) {
  821.     format0 {
  822.         doesntShowOnCustom, notRemovable, dontForceRestart,
  823.         0, 0, "Package for 68K Macintosh",
  824.             {    
  825.             // 68K Macintosh CODE Resources ( always overwrite )
  826.             'inra', 500,    
  827.             'inra', 501,    
  828.             'inra', 502    
  829.             }
  830.         }
  831.     };
  832.  
  833. // Sub-Package of PowerMac warning when launched on 68K
  834. // • this option is to be used when the target application is not already present
  835. resource 'inpk' ( kInstallPowMacWarnOn68K ) {
  836.     format0 {
  837.         doesntShowOnCustom, notRemovable, dontForceRestart,
  838.         0, 0, "Package for Power Macintosh warning on 68K",
  839.             {    
  840.             'inrm', 400,    // PowerMac Warning stuff
  841.             }
  842.         }
  843.     };
  844.  
  845. // Sub-Package of PowerMac warning when launched on 68K
  846. // • this option is to be used when the target application is already present
  847. resource 'inpk' ( kUpdatePowMacWarnOn68K ) {
  848.     format0 {
  849.         doesntShowOnCustom, notRemovable, dontForceRestart,
  850.         0, 0, "Package for Power Macintosh warning on 68K",
  851.             {    
  852.             'inra', 600,    // PowerMac Warning stuff
  853.             'inra', 601,    // PowerMac Warning stuff
  854.             'inra', 602,    // PowerMac Warning stuff
  855.             'inra', 603,    // PowerMac Warning stuff
  856.             'inra', 604,    // PowerMac Warning stuff
  857.             }
  858.         }
  859.     };
  860.  
  861. // Sub-Package of PowerMac data fork and PowerMac specific resources
  862. resource 'inpk' ( kPowerMacStuff ) {
  863.     format0 {
  864.         doesntShowOnCustom, notRemovable, dontForceRestart,
  865.         0, 0, "Package for Power Macintosh",
  866.             {    
  867.             // Power Macintosh Data Fork ( always overwrite )
  868.             'infa', kPowerMacFileAtom,    
  869.             
  870.             // 'cfrg' resource detailing contents of code in data fork
  871.             'inra', kPowerMacRsrcAtom,
  872.             
  873.             // NOTE: Because we have chosen to specify that the resource
  874.             // fork will not be replaced when installing the kPowerMacStuff
  875.             // file atom ( by setting 'noRsrcFork' in the atom ) we must
  876.             // install the one resource item for 'cfrg' with a seperate
  877.             // resource atom.
  878.             }
  879.         }
  880.     };
  881.  
  882.  
  883. // package comment for Fat application ( pre-4.0 package comments )
  884. resource 'icmt' ( kUpdateFullFatApp ) {
  885.     currentReleaseDate, currentVersion, 30000,
  886.     "This contains the Demo Application, which can be run on any Macintosh."
  887.     };
  888.  
  889. // package comment for Fat application ( pre-4.0 package comments )
  890. resource 'icmt' ( kInstallFullFatApp ) {
  891.     currentReleaseDate, currentVersion, 30000,
  892.     "This contains the Demo Application, which can be run on any Macintosh."
  893.     };
  894.  
  895. // package comment for 68K application ( pre-4.0 package comments )
  896. resource 'icmt' ( kOverWrite68KApp ) {
  897.     currentReleaseDate, currentVersion, 30000,
  898.     "This contains the Demo Application for use on 68K Macintosh."
  899.     };
  900.  
  901. // package comment for PowerMac application ( pre-4.0 package comments )
  902. resource 'icmt' ( kUpdatePowerMacApp ) {
  903.     currentReleaseDate, currentVersion, 30000,
  904.     "This contains the Demo Application for use on Power Macintosh."
  905.     };
  906.  
  907. // just a good old application icon
  908. // to be included in the package comment resources above
  909. data 'ICON' (30000) {
  910.     $"0001 0000 0002 8000 0004 4000 0008 2000"
  911.     $"0010 1000 0020 0800 0040 0400 0080 0200"
  912.     $"0100 0100 0200 0080 0400 0040 0800 0020"
  913.     $"1000 0010 2000 0008 4000 3F04 8000 4082"
  914.     $"4000 8041 2001 3022 1001 C814 080E 7F8F"
  915.     $"0402 3007 0201 0007 0100 8007 0080 6007"
  916.     $"0040 1FE7 0020 021F 0010 0407 0008 0800"
  917.     $"0004 1000 0002 2000 0001 4000 0000 8000"
  918.     };
  919.  
  920.  
  921. /************************** Atoms resources **********************************/
  922.  
  923.  
  924. // ResMerge Atom to install common resources
  925. resource 'inrm' ( kCommonStuff ) {
  926.     format0 {
  927.         0,                // Total size of resources
  928.                         // ( filled in by ScriptCheck if 0 )
  929.                         
  930.         10000,            // Target File Spec
  931.         
  932.         20001,            // Source File Spec 
  933.                         // Demo App Parts:Common Part
  934.                         
  935.         "Installing Common Resources"
  936.     }
  937. };
  938.  
  939. // ResMerge Atom to install 68K CODE resources
  940. resource 'inrm' ( k68KStuff ) {
  941.     format0 {
  942.         0,                // Total size of resources
  943.                         // ( filled in by ScriptCheck if 0 )
  944.                         
  945.         10000,            // Target File Spec
  946.         
  947.         20004,            // Source File Spec
  948.                         // Demo App Parts:68K Part
  949.         ""
  950.     }
  951. };
  952.  
  953. // "PowerMac Warn on 68K" resource items
  954. resource 'inrm' (400) {
  955.     format0 {
  956.         0,                // Total size of resources
  957.                         // ( filled in by ScriptCheck if 0 )
  958.                         
  959.         10000,            // Target File Spec
  960.         
  961.         20004,            // Source File Spec 
  962.                         // Demo App Parts:PowerMacWarnOn68K Part
  963.                         
  964.         ""
  965.     }
  966. };
  967.  
  968. // This File Atom deletes the entire file on removals
  969. resource 'infa' ( kDeleteFullApp ) {
  970.     format1 {
  971.         deleteWhenRemoving,                // make sure atom is included on removal
  972.         dontDeleteWhenInstalling,        // ignore atom during installs
  973.         dontCopy,                        // ignore atom during installs
  974.         dontIgnoreLockedFile,            // don't remove a locked file
  975.         
  976.         dontSetFileLocked,                // ignored during removals
  977.         useSrcCrDateToCompare,            // ignored during removals
  978.         srcNeedExist,                    // ignored during removals
  979.         rsrcForkInRsrcFork,
  980.         leaveAloneIfNewer,                // ignored during removals
  981.         updateExisting,                 // ignored during removals
  982.         copyIfNewOrUpdate,                // ignored during removals
  983.         
  984.         rsrcFork,                        // remove resource fork
  985.         dataFork,                        // remove data fork
  986.         0,
  987.         0,
  988.         10000,                            // target spec for removal
  989.         {    0, 0, 0    },                    // no source spec needed for removal
  990.         0x0,
  991.         0,
  992.         0,
  993.         ""
  994.     }
  995. };
  996.  
  997.  
  998.  
  999. // Installs PowerMac Native Mode RISC code contained in data fork
  1000. // NOTE: this does NOT overwrite existing resource fork !!
  1001. // • uses InstaCompOne decompression from file archive
  1002. resource 'infa' ( kPowerMacFileAtom ) {
  1003.     format1 {
  1004.         dontDeleteWhenRemoving,
  1005.         dontDeleteWhenInstalling,
  1006.         copy,
  1007.         dontIgnoreLockedFile,
  1008.         dontSetFileLocked,
  1009.         useVersProcToCompare,    
  1010.         srcNeedExist,
  1011.         rsrcForkInDataFork,                // InstaCompOne file compression
  1012.                                         // always put rsrc's in data fork
  1013.         leaveAloneIfNewer,
  1014.         updateExisting,
  1015.         copyIfNewOrUpdate,
  1016.         
  1017.         noRsrcFork,                        // because this flag is set
  1018.                                         // to 'noRsrcFork' this atom
  1019.                                         // will not disturb resource
  1020.                                         // fork of target file
  1021.         dataFork,
  1022.         0,                                
  1023.         
  1024.         0x2000+0x0040,                    // finder attribute flags - when copying
  1025.                                         // a bona fide file, ScriptCheck can set
  1026.                                         // this value. But since we copying
  1027.                                         // the data fork from a file that is not
  1028.                                         // the original application, we must set
  1029.                                         // these Finder attributes manually
  1030.                                         
  1031.         10000,                            // target spec for install
  1032.         {    20005,                         // source spec for install
  1033.             0, 
  1034.             0    
  1035.         },
  1036.         0x01008000,                        // version number 1.0
  1037.         
  1038.                                         // WARNING: It is probably best
  1039.                                         // to include a 'vers' resource
  1040.                                         // of ID (1) or (2) in the archive
  1041.                                         // file containing the data fork
  1042.                                         // for PowerMac so that version 
  1043.                                         // comparison to existing file will
  1044.                                         // be performed correctly. A non-zero
  1045.                                         // value for the version field should
  1046.                                         // not be updated by ScriptCheck, but
  1047.                                         // ScriptCheck 4.0.3 seems to update
  1048.                                         // this field no matter what. Use the
  1049.                                         // 'vers' resource from the Common Part
  1050.                                         // and paste it into the file archive.
  1051.         0,                                
  1052.         241,                            // InstaCompOne atom extender ID                                
  1053.         
  1054.         ""                                // atom description
  1055.     }
  1056. };
  1057.  
  1058.  
  1059. // PowerMac 'cfrg' resource item
  1060. resource 'inra' ( kPowerMacRsrcAtom ) {
  1061.     format1 {
  1062.         dontDeleteWhenRemoving,
  1063.         dontDeleteWhenInstalling,
  1064.         copy,
  1065.         leaveAloneIfNewer,
  1066.         noTgtRequired,
  1067.         updateExisting,
  1068.         copyIfNewOrUpdate,
  1069.         ignoreProtection,
  1070.         srcNeedExist,
  1071.         byID,
  1072.         nameNeedNotMatch,
  1073.         0,
  1074.         10000,
  1075.         'cfrg',
  1076.         0,
  1077.         0x0,
  1078.         "",
  1079.         {    20003, 'cfrg', 0, 0, ""    },
  1080.         0x0,
  1081.         0,
  1082.         0,
  1083.         ""
  1084.         }
  1085.     };
  1086.  
  1087. // "PowerMac Warn on 68K" resource item
  1088. resource 'inra' (600) {
  1089.     format1 {
  1090.         dontDeleteWhenRemoving,
  1091.         dontDeleteWhenInstalling,
  1092.         copy,
  1093.         leaveAloneIfNewer,
  1094.         noTgtRequired,
  1095.         keepExisting,
  1096.         copyIfNewOrUpdate,
  1097.         ignoreProtection,
  1098.         srcNeedExist,
  1099.         byID,
  1100.         nameNeedNotMatch,
  1101.         0,
  1102.         10000,
  1103.         'CODE',
  1104.         0,
  1105.         0x0,
  1106.         "",
  1107.         {    20004, 'CODE', 0, 0, ""    },
  1108.         0x0,
  1109.         0,
  1110.         0,
  1111.         ""
  1112.         }
  1113.     };
  1114.  
  1115. // "PowerMac Warn on 68K" resource item
  1116. resource 'inra' (601) {
  1117.     format1 {
  1118.         dontDeleteWhenRemoving,
  1119.         dontDeleteWhenInstalling,
  1120.         copy,
  1121.         leaveAloneIfNewer,
  1122.         noTgtRequired,
  1123.         keepExisting,
  1124.         copyIfNewOrUpdate,
  1125.         ignoreProtection,
  1126.         srcNeedExist,
  1127.         byID,
  1128.         nameNeedNotMatch,
  1129.         0,
  1130.         10000,
  1131.         'CODE',
  1132.         1,
  1133.         0x0,
  1134.         "",
  1135.         {    20004, 'CODE', 1, 0, ""    },
  1136.         0x0,
  1137.         0,
  1138.         0,
  1139.         ""
  1140.         }
  1141.     };
  1142.  
  1143. // "PowerMac Warn on 68K" resource item
  1144. resource 'inra' (602) {
  1145.     format1 {
  1146.         dontDeleteWhenRemoving,
  1147.         dontDeleteWhenInstalling,
  1148.         copy,
  1149.         leaveAloneIfNewer,
  1150.         noTgtRequired,
  1151.         keepExisting,
  1152.         copyIfNewOrUpdate,
  1153.         ignoreProtection,
  1154.         srcNeedExist,
  1155.         byID,
  1156.         nameNeedNotMatch,
  1157.         0,
  1158.         10000,
  1159.         'ALRT',
  1160.         27309,
  1161.         0x0,
  1162.         "",
  1163.         {    20004, 'ALRT', 27309, 0, ""    },
  1164.         0x0,
  1165.         0,
  1166.         0,
  1167.         ""
  1168.         }
  1169.     };
  1170.  
  1171. // "PowerMac Warn on 68K" resource item
  1172. resource 'inra' (603) {
  1173.     format1 {
  1174.         dontDeleteWhenRemoving,
  1175.         dontDeleteWhenInstalling,
  1176.         copy,
  1177.         leaveAloneIfNewer,
  1178.         noTgtRequired,
  1179.         keepExisting,
  1180.         copyIfNewOrUpdate,
  1181.         ignoreProtection,
  1182.         srcNeedExist,
  1183.         byID,
  1184.         nameNeedNotMatch,
  1185.         0,
  1186.         10000,
  1187.         'DITL',
  1188.         27309,
  1189.         0x0,
  1190.         "",
  1191.         {    20004, 'DITL', 27309, 0, ""    },
  1192.         0x0,
  1193.         0,
  1194.         0,
  1195.         ""
  1196.         }
  1197.     };
  1198.  
  1199. // "PowerMac Warn on 68K" resource item
  1200. resource 'inra' (604) {
  1201.     format1 {
  1202.         dontDeleteWhenRemoving,
  1203.         dontDeleteWhenInstalling,
  1204.         copy,
  1205.         leaveAloneIfNewer,
  1206.         noTgtRequired,
  1207.         keepExisting,
  1208.         copyIfNewOrUpdate,
  1209.         ignoreProtection,
  1210.         srcNeedExist,
  1211.         byID,
  1212.         nameNeedNotMatch,
  1213.         0,
  1214.         10000,
  1215.         'STR ',
  1216.         27309,
  1217.         0x0,
  1218.         "",
  1219.         {    20004, 'STR ', 27309, 0, ""    },
  1220.         0x0,
  1221.         0,
  1222.         0,
  1223.         ""
  1224.         }
  1225.     };
  1226.  
  1227. // 68K CODE resource item
  1228. resource 'inra' (500) {
  1229.     format1 {
  1230.         dontDeleteWhenRemoving,
  1231.         deleteWhenInstalling,
  1232.         copy,
  1233.         leaveAloneIfNewer,
  1234.         noTgtRequired,
  1235.         updateExisting,
  1236.         copyIfNewOrUpdate,
  1237.         ignoreProtection,
  1238.         srcNeedExist,
  1239.         byID,
  1240.         nameNeedNotMatch,
  1241.         0,
  1242.         10000,
  1243.         'CODE',
  1244.         0,
  1245.         0x0,
  1246.         "",
  1247.         {    20002, 'part', 0, 0, ""    },
  1248.         0x0,
  1249.         0,
  1250.         241,
  1251.         ""
  1252.         }
  1253.     };
  1254.  
  1255. // 68K CODE resource item
  1256. resource 'inra' (501) {
  1257.     format1 {
  1258.         dontDeleteWhenRemoving,
  1259.         deleteWhenInstalling,
  1260.         copy,
  1261.         leaveAloneIfNewer,
  1262.         noTgtRequired,
  1263.         updateExisting,
  1264.         copyIfNewOrUpdate,
  1265.         ignoreProtection,
  1266.         srcNeedExist,
  1267.         byID,
  1268.         nameNeedNotMatch,
  1269.         0,
  1270.         10000,
  1271.         'CODE',
  1272.         1,
  1273.         0x0,
  1274.         "",
  1275.         {    20002, 'part', 1, 0, ""    },
  1276.         0x0,
  1277.         0,
  1278.         241,
  1279.         ""
  1280.         }
  1281.     };
  1282.  
  1283. // 68K CODE resource item
  1284. resource 'inra' (502) {
  1285.     format1 {
  1286.         dontDeleteWhenRemoving,
  1287.         deleteWhenInstalling,
  1288.         copy,
  1289.         leaveAloneIfNewer,
  1290.         noTgtRequired,
  1291.         updateExisting,
  1292.         copyIfNewOrUpdate,
  1293.         ignoreProtection,
  1294.         srcNeedExist,
  1295.         byID,
  1296.         nameNeedNotMatch,
  1297.         0,
  1298.         10000,
  1299.         'CODE',
  1300.         2,
  1301.         0x0,
  1302.         "",
  1303.         {    20002, 'part', 2, 0, ""    },
  1304.         0x0,
  1305.         0,
  1306.         241,
  1307.         ""
  1308.         }
  1309.     };
  1310.  
  1311.  
  1312. /********************* Target File Spec. resources *****************************/
  1313.  
  1314. // target spec for all the various incarnations of application
  1315. resource 'intf' (10000) {
  1316.     format1 {
  1317.         noSearchForFile,                     // use default search path
  1318.         TypeCrNeedNotMatch,                 // target TYPE,CREATOR need not match
  1319.         'APPL',                             // target TYPE ( ignored, see above )
  1320.         'moda',                             // target CREATOR ( ignored, see above )
  1321.         0x2000+0x0040,                         // finder attribute flags
  1322.         1,                                      // creation date for new file
  1323.         1,                                      // modification date for new file
  1324.         0,                                     // search proc ID ( 'insp' )
  1325.         
  1326.         "folder-user:ModApp"                 // path to target file
  1327.                                             // NOTE: The filename contained
  1328.                                             // in the path to target file is
  1329.                                             // used as the filename to extract
  1330.                                             // from an archive when InstaCompOne
  1331.                                             // is called from within a file atom
  1332.                                             // and this 'intf' is used. This same
  1333.                                             // filename must be used when compressing 
  1334.                                             // the file into the archive ( makefile ).
  1335.         }
  1336.     };
  1337.  
  1338.  
  1339. /********************* Source File Spec. resources *****************************/
  1340.  
  1341. resource 'infs' (20001) {
  1342.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1343.     "Disk 1:Common Part"
  1344.     };
  1345.  
  1346. // NOTE: The type for resource archives is 'ircp' ( installer resource compression )
  1347. resource 'infs' (20002) {
  1348.     'ircp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
  1349.     "Disk 1:68KRsrcArchive"
  1350.     };
  1351.  
  1352. resource 'infs' (20003) {
  1353.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1354.     "Disk 1:Power Macintosh Part"
  1355.     };
  1356.  
  1357. // NOTE: The type for file archives is 'idcp' ( installer data compression )
  1358. resource 'infs' (20005) {
  1359.     'idcp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
  1360.     "Disk 1:PowMacFileArchive"
  1361.     };
  1362.  
  1363. resource 'infs' (20004) {
  1364.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1365.     "Disk 1:PowerMacWarnOn68K Part"
  1366.     };
  1367.  
  1368.  
  1369.  
  1370. resource 'inrf' (kCheckIfInternalDriveUFID) {
  1371.     format0 {
  1372.         userFunctionType,        // code resource type
  1373.         143,                    // code resource ID
  1374.         0,                        // refCon 
  1375.         
  1376.         0,                        // use installer's heap, 
  1377.                                 // instead of a seperate subheap
  1378.         
  1379.         "This Rule Function returns TRUE if the target volume has SCSI ID = 0."
  1380.         }
  1381.     };
  1382.  
  1383. //     The preferenece resource allows that script writer to specify 
  1384. //    certain attributes of the Installer's interface and actions.  
  1385. //    This resource is the default if the script writer does not provide one.
  1386. resource 'inpr' (300) {
  1387.     format0 {
  1388.         useFolderTargetMode,            // allow user to select target folder
  1389.         dontAllowUserToSetSystemDisk,    // we're not installing to system folder
  1390.         showSelectedSizeInCustom,
  1391.         noSetupFunctionSupplied,
  1392.         dontAllowCleanInstall,
  1393.         dontAllowServerAsTarget,
  1394.         0,
  1395.         0,
  1396.             {    
  1397.             301, 311, 301, 311,
  1398.             302, 312, 302, 312
  1399.             },
  1400.         "Demo Application Folder"
  1401.         }
  1402.     };
  1403.  
  1404.  
  1405.  
  1406.